﻿using Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AnesSystem.ViewModels
{
    public abstract class DrugBaseViewModel : MultitonBaseViewModel
    {
        #region Variables

        #endregion


        #region Constructor

        #endregion


        #region Properties


        #endregion


        #region 依赖属性


        #endregion


        #region Event


        #endregion


        #region PrivateMethods


        #endregion


        #region Public/ProtectedMethods

        public void CalTotalAmount()
        {
            if (HospitalConfig.Instance.CurrentHospital.HospitalCode.Equals(HospitalConfig.HOSPITAL_CODE_CQ_NTZYY) || HospitalConfig.Instance.CurrentHospital.HospitalCode.Equals(HospitalConfig.HOSPITAL_CODE_SC_SCDC))
            {
                AnesRecordUtil.Instance.CalLiquidInAndOutByType();
                if (HospitalConfig.Instance.CurrentHospital.HospitalCode.Equals(HospitalConfig.HOSPITAL_CODE_CQ_NTZYY))
                {
                    AnesRecordUtil.Instance.CalSingleLiquidInAndOut();
                    if (DataManager.Instance.CurrentPatientLink.Status.OutRoomTime != new DateTime())
                    {
                        AnesRecordUtil.Instance.CalContinueLiquidInAndOut();
                    }
                }
                AnesRecordUtil.Instance.CalInTotal();
            }
        }

        public DateTime GetPageStartTime()
        {
            DateTime AnesRecordStartTime = DataManager.Instance.CurrentPatientLink.Status.AnesRecordStartTime;
            DateTime pageStartTime = AnesRecordStartTime.AddHours(4 * (CurPage - 1));
            return pageStartTime;
        }

        public DateTime GetPageEndTime()
        {
            DateTime AnesRecordStartTime = DataManager.Instance.CurrentPatientLink.Status.AnesRecordStartTime;
            DateTime pageEndTime = AnesRecordStartTime.AddHours(4 * (CurPage));
            return pageEndTime;
        }

        public DateTime GetPacuPageStartTime()
        {
            DateTime PacuStartTime = DataManager.Instance.CurrentPatientLink.Status.PacuStartTime;
            DateTime pageStartTime = PacuStartTime.AddHours(4 * (CurPage - 1));
            return pageStartTime;
        }

        public DateTime GetPacuPageEndTime()
        {
            DateTime PacuStartTime = DataManager.Instance.CurrentPatientLink.Status.PacuStartTime;
            DateTime pageEndTime = PacuStartTime.AddHours(4 * (CurPage));
            return pageEndTime;
        }
        #endregion


        #region EventHandlers


        #endregion
    }
}
